


<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
String applicationPath = basePath + "/" + "application";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>待选择项目列表</title>
<link href="<%=path%>/css/jinmu_style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="<%=path%>/js/util.js"></script>
<base   target="_self">
</head>
<body >

<html:form styleId="projectrfpsForm" action="popuSelectProjectrfps.do?method=popuSelectProjectrfps">
      <input type="hidden" id="totalPage" value="${totalPage}"/>
     <table cellspacing="0" cellpadding="0" width="98%" align="center"  border="0" class="margtb5">
	    <tr>
	      <td align="left" class="padl5 lan12"><img src="<%=path%>/images/img-11.gif" width="12" height="12">&nbsp;待选择项目列表&nbsp;</td>
	    </tr>
	 </table>

 <table cellspacing="3" cellpadding="0" width="98%" align="center"  border="0" class="kuang2 margtb5 hei12">
		<tr>
		     <td width="6%" align="right"><bean:message key="com.application.projectrfps.entity.projectrfps.listpage.year" bundle="projectrfps" />：</td>
	           <td width="10%">
		      	<ssh:select propertyName="year" dataSource="collection" selectList="${yearSelect}"  type="1" defaultName="${projectrfpsForm.year}"/>
		       </td>
        
                <td width="6%" align="right"><bean:message key="com.application.projectrfps.entity.projectrfps.listpage.projectname" bundle="projectrfps" />：</td>
	            <td width="15%">
		      		      <html:text property="projectname"/>
		        </td>
                   		  <td width="22%"><input class="buttonbg" id="but_query" type="button" value="<bean:message key='com.syc.common.projectworksheets.query'  bundle="projectworksheets"/>" name="but_query" onClick="query();" /></td>
		</tr>
	</table>
	




				
	<table cellspacing="0" cellpadding="0" width="98%" align="center"  border="0" class="margb5">
    
			<tr>
				<td>			
						<fmt:bundle
							basename="com.application.projectrfps.struts.ApplicationResources_projectrfps">
							<display:table name="projectrfpsList" class="simple"
								id="projectrfpss" pagesize="10" partialList="true"
								 defaultorder="descending" size="resultSize"
								requestURI="popuSelectProjectrfps.do?method=popuSelectProjectrfps">
								
    							<display:column title="选择"
									sortable="false" 
									style=" width:5%; text-align:center;">
	<input type="hidden" id="${projectrfpss.id}projectname" name="${projectrfpss.id}projectname" value="${projectrfpss.projectname}"/>
	<input type="hidden" name="${projectrfpss.id}id"  id="${projectrfpss.id}id" value="${projectrfpss.id}"/>		
	<input type="hidden" name="${projectrfpss.id}principalid" id="${projectrfpss.id}principalid" value="${projectrfpss.principalid}"/>		
	<input type="hidden" id="${projectrfpss.id}principal" name="${projectrfpss.id}principal" value="${projectrfpss.principal}"/>		
	<input type="hidden" name="${projectrfpss.id}departid" id="${projectrfpss.id}departid" value="${projectrfpss.departid}"/>		
	<input type="hidden" name="${projectrfpss.id}departname" id="${projectrfpss.id}departname" value="${projectrfpss.departname}"/>		
	<input type="hidden" name="${projectrfpss.id}starttime" id="${projectrfpss.id}starttime" value="<bean:write name="projectrfpss" property="starttime" format="yyyy-MM-dd"/>"/>		
	<input type="hidden" name="${projectrfpss.id}endtime" id="${projectrfpss.id}endtime" value="<bean:write name="projectrfpss" property="endtime" format="yyyy-MM-dd"/>"/>		
	<input type="hidden" name="${projectrfpss.id}projecttype" id="${projectrfpss.id}projecttype" value="${projectrfpss.projecttype}"/>		
	<input type="hidden" name="${projectrfpss.id}year" id="${projectrfpss.id}year"  value="${projectrfpss.year}"/>		
	<input type="hidden" name="${projectrfpss.id}equipment" id="${projectrfpss.id}equipment" value="${projectrfpss.equipment}"/>		
	<input type="hidden" name="${projectrfpss.id}costStruct" id="${projectrfpss.id}costStruct" value="${projectrfpss.costStruct}"/>		
	<input type="hidden" name="${projectrfpss.id}costplanning" id="${projectrfpss.id}costplanning" value="<bean:write name ='projectrfpss' property='costplanning' format='########.####'/>"/>										
							       <input type='CheckBox'  name='selectId' id="selectId"
	        onclick="chooseProject('${projectrfpss.id}');"/>
							    </display:column>

                                
                              <display:column titleKey="com.application.projectrfps.entity.projectrfps.listpage.projectname" sortable="true" style="width:15%; text-align:center;">
                                <!--  <a onclick="viewProjectrfps('${projectrfpss.id}');" href="#" >${projectrfpss.projectname}</a> -->
                                ${projectrfpss.projectname} 
                                </display:column>
                             
								<display:column property="departname"  style=" width:5%; text-align:center;"
									titleKey="com.application.projectrfps.entity.projectrfps.listpage.departname"
									sortable="true"/>
								<display:column property="principal"  style=" width:5%; text-align:center; "
									titleKey="com.application.projectrfps.entity.projectrfps.listpage.principal"
									sortable="true"/>
								<display:column property="year"  style=" width:5%; text-align:center;"
									titleKey="com.application.projectrfps.entity.projectrfps.listpage.year"
									sortable="true"/>
									
							</display:table>
						</fmt:bundle>
				</td>
			</tr>
		</table>
		<br><br><br><br>
		
		
		
		 <table width="100%" border="0" cellspacing="0" cellpadding="0">
				  <tr>
				    <td align="center">
				     <input class="buttonbg" id="but_return" type="button" value="<bean:message key='com.syc.common.projectworksheets.close'  bundle="projectworksheets"/>" name="but_return"" onClick="javascript:window.close();"/>
				  </tr>
				</table>

     </html:form>
	</body>
</html>
<script>

function query(){
	document.forms[0].action="popuSelectProjectrfps.do?method=popuSelectProjectrfps";
	document.forms[0].submit();
}

	
	
function validateSelect(){ 
    var count = 0;
    var jysBox = $s("id");
    for(var i=0;i<jysBox.length;i++){
		if(jysBox[i].checked){
        	count++;
		}
	}
    return count;
}

//查看
function view(){
	var result = validateSelect();
	if(result==0){
		alert("请选择一条记录！");
		return;
	}else if(result>1){
	    alert("一次只能查看一条记录！");
		return;
	}else{
		document.forms[0].action="viewProjectworksheets.do?method=viewProjectworksheets";
	    document.forms[0].submit();
	}
}

function viewProjectrfps(id){
   document.forms[0].action="viewProjectrfps.do?method=viewProjectrfps&id=" + id;
   document.forms[0].submit();
}

//全选   
function checkAll()   
{ 
  
   var chk=document.getElementsByName("id");   
   for(var i=0;i<chk.length;i++)   
   { 
     if($('checkall').checked){
     	chk(i).checked=true; 
     	chk(i).onclick();
     }else{
        chk(i).checked=false; 
     } 
       
 }
}   

this.returnValue = new Array();
function chooseProject(id){
   var projectname = id+'projectname';
   var pid = id+'id';
   var principalid = id+'principalid';
   var principal = id+'principal';
   var departid = id+'departid';
   var departname = id+'departname';
   var starttime = id+'starttime';
   var endtime = id+'endtime';
   var projecttype = id+'projecttype';
   var year = id+'year';
   var equipment = id+'equipment';
   var costStruct = id+'costStruct';
   var costplanning = id+'costplanning';
   this.returnValue["projectname"]= $(projectname).value;
   this.returnValue["id"]= $(pid).value;
   this.returnValue["principalid"]= $(principalid).value;
   this.returnValue["principal"]= $(principal).value;
   this.returnValue["departid"]= $(departid).value;
   this.returnValue["departname"]= $(departname).value;
   this.returnValue["starttime"]= $(starttime).value;
   this.returnValue["endtime"]= $(endtime).value;
   this.returnValue["projecttype"]= $(projecttype).value;
   this.returnValue["year"]= $(year).value;
   this.returnValue["equipment"]= $(equipment).value;
   this.returnValue["costStruct"]= $(costStruct).value;
   this.returnValue["cost"] = $(costplanning).value;

   window.close();
}
</script>
